<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    229. Majority Element II
   </h1>
   <p>
    Given an integer array of size
    <i>
     n
    </i>
    , find all elements that appear more than
    <code>
     &lfloor; n/3 &rfloor;
    </code>
    times.
   </p>
   <p>
    <strong>
     Note:
    </strong>
    The algorithm should run in linear time and in O(1) space.
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [3,2,3]
<strong>Output:</strong> [3]</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [1,1,1,3,3,2,2,2]
<strong>Output:</strong> [1,2]</pre>
  </div>
  <div>
   <h1 class="question_title">
    229. 求众数 II
   </h1>
   <p>
    给定一个大小为&nbsp;
    <em>
     n&nbsp;
    </em>
    的数组，找出其中所有出现超过&nbsp;
    <code>
     &lfloor; n/3 &rfloor;
    </code>
    &nbsp;次的元素。
   </p>
   <p>
    <strong>
     说明:
    </strong>
    要求算法的时间复杂度为 O(n)，空间复杂度为 O(1)。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
   </p>
   <pre><strong>输入:</strong> [3,2,3]
<strong>输出:</strong> [3]</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,1,1,3,3,2,2,2]
<strong>输出:</strong> [1,2]</pre>
  </div>
 </body>
</html>